﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Calculator.aspx.cs" Inherits="Calculator.Calculator" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        
        #Text1
        {
            width: 337px;
        }
        #Button1, #Button2,#Button3,#Button4,#Button5,#Button6,#Button7,#Button8,#Button9,#Button0,#ButtonDot,#Button00
        {
            width: 40px;
        }
        #calcDisplay
        {
            text-align:right;
            width:400px;
        }
    </style>
    <script language="javascript" type="text/javascript">
// <![CDATA[

        function Button_onclick(sender) {
            if (sender.value == "." && (document.getElementById("calcDisplay").value.length == 0 || document.getElementById("calcDisplay").value.indexOf(".") > 0))
                return false;
            document.getElementById("calcDisplay").value += sender.value;
            return false;
        }

// ]]>
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="height: 275px">
    
        &nbsp;<div id="currentExpression" dir="rtl" 
            style="width: 440px" runat="server">
        </div>
    
        <br />
        <input type="text" id="calcDisplay" runat="server" readonly="readonly"  />
        <br />
        <br />
        <input id="Button7" type="button" value="7" onclick="return Button_onclick(this);"  />
        <input id="Button8" type="button" value="8" onclick="return Button_onclick(this);"  />
        <input id="Button9" type="button" value="9" onclick="return Button_onclick(this);"  />&nbsp;
        <asp:Button ID="ButtonPlus" runat="server" Text="+" Width="40px" />
&nbsp;
        <asp:Button ID="ButtonC" runat="server" Text="C" Width="40px" 
            onclick="ButtonC_Click" />
        <br />
        <input id="Button4" type="button" value="4" onclick="return Button_onclick(this);"  />
        <input id="Button5" type="button" value="5" onclick="return Button_onclick(this);"  />
        <input id="Button6" type="button" value="6" onclick="return Button_onclick(this);"  />&nbsp;
        <asp:Button ID="ButtonMinus" runat="server" Text="-" Width="40px" />
&nbsp;
        <asp:Button ID="ButtonAbs" runat="server" Text="abs" Width="40px" />
        <br />
        <input id="Button1" type="button" value="1" onclick="return Button_onclick(this);"  />
        <input id="Button2" type="button" value="2" onclick="return Button_onclick(this);"  />
        <input id="Button3" type="button" value="3" onclick="return Button_onclick(this);"  />&nbsp;
        <asp:Button ID="ButtonMulti" runat="server" Text="x" Width="40px" />
&nbsp;
        <asp:Button ID="ButtonSqrt" runat="server" Text="sqrt" Width="40px" />
        <br />
        <input id="Button0" type="button" value="0" onclick="return Button_onclick(this);" />
        <input id="ButtonDot" type="button" value="." onclick="return Button_onclick(this);"  />
        <input id="Button00" type="button" value="00" onclick="return Button_onclick(this);"  />&nbsp;
        <asp:Button ID="ButtonDivide" runat="server" Text="/" Width="40px" />
&nbsp;
        <asp:Button ID="ButtonCalculate" runat="server" Text="=" Width="40px" />
    
    </div>
    </form>
</body>
</html>
